package com.trivia.restResponses

import com.trivia.Level;

class GetQuestionsAndAnswersResponse extends RestResponse {
	
	def friends=[]
	
	def questions
	
	def ownProperties(){
		intermediateXML = "<questions>"		
		questions.each {
			intermediateXML += "<question id=\"" + it.id + "\">"
			intermediateXML += "<statement>" + it.statement + "</statement>"
			intermediateXML += "<helpMessage>" + it.helpMessage + "</helpMessage>"
			intermediateXML += "<answers>"
			it.answers.each {
				intermediateXML += "<answer id=\"" + it.id + "\" status=\"" + it.status + "\">" + it.statement + "</answer>"
			}			
			intermediateXML += "</answers>"			
			intermediateXML += "</question>"
		}
		intermediateXML += "</questions>"
		intermediateXML
	}

}
